package com.example.shopdemo.enums;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-01-24
 **/
public enum ShopCategoryStateEnum {


    SUCCESS(0, "创建成功"),
    INNER_ERROR(-1001, "操作失败"),
    EMPTY(-1002, "区域信息为空");

    private int key;

    private String value;

    private ShopCategoryStateEnum(int key, String value) {

        this.key = key;
        this.value = value;
    }


    public int getKey(){
        return key;
    }
    public String getValue(){
        return value;
    }

    public static ShopCategoryStateEnum stateOf(int index) {
        for (ShopCategoryStateEnum state : values()) {
            if (state.getKey() == index) {
                return state;
            }
        }
        return null;
    }


}
